import pdfplumber
f=pdfplumber.open('test.pdf')
page=f.pages[1]
img=page.to_image()
img.save('test.png',format='PNG')
f.close()
